#ifndef _OGSOLVERBBP_H_
#define _OGSOLVERBBP_H_

#include "gsupplyLinkProblem.h"
#include "gsupplyLinkSolution.h"
#include "ogsupplyLinkSolutionPartial.h"


/**
 * A BBP solver : starts with jobs with last due dates
 *
 */
class OGSolverBBP {

    protected:
        GSupplyLinkProblem& problem ;
        GSupplyLinkSolution bestSolution ;
        GSupplyLinkSolution bestSolutionDueDateOrdered ;
        OGSupplyLinkSolutionPartial currentSolutionDueDateOrdered ;
        double maxValue ;

        /**
         * Minimum and Maximum number of batches
         */
        int minBatch, maxBatch;

    public:
        OGSolverBBP(GSupplyLinkProblem& pb) ;
        ~OGSolverBBP() ;

        // Inlines
        inline GSupplyLinkSolution& getBestSolution() { return bestSolution ; }
        inline GSupplyLinkSolution& getBestSolutionDueDateOrdered() { return bestSolutionDueDateOrdered ; }

        void solve() ;
        virtual void solveInit()=0 ;
        virtual void solveMain() = 0 ;
        virtual void solveEnd()=0 ;

        void initBestSolutionWithFFD() ;
} ;

#endif
